package com.stu.reflection.factory;

public class SimpleFactory {
  private SimpleFactory() {}
  public static IMessage getInstanceOfMessage(String className) {
    if("netmessage".equalsIgnoreCase(className)) return new NetMessage();
		if("localmessage".equalsIgnoreCase(className)) return new LocalMessage();
		return null;
  }
  public static IAnimal getInstanceOfAnimal(String className) {
    if("Cat".equalsIgnoreCase(className)) return new Cat();
		if("Dog".equalsIgnoreCase(className)) return new Dog();
		return null;
  }
}
